1. Field of the Invention
The present invention generally relates to image processing apparatuses such as image coding/decoding apparatuses, and particularly relates to an image processing apparatus such as an image coding/decoding apparatus used in a digital still camera, a digital video camera, or the like.
2. Description of the Related Art
In general, the coding of image data produces a code series by attending to orthogonal transform of image data from a special domain to a frequency domain and by carrying out quantization and entropy coding. In this process, an image region is generally divided into sub-regions each comprised of a plurality of pixels, followed by coding the obtained sub-regions. In JPEG, for example, an original image is divided into block areas each comprised of 8×8 pixels, and DCT is applied to each block area, followed by quantization and Huffman coding.
In the wavelet transform, which can generally produces images of higher quality than DCT, the size of an image is preferably 2m×2n (m, n: positive integer), as will be described later. The wavelet transform decomposes an image into lower frequency components and higher frequency components in the horizontal direction and in the vertical direction. The lower frequency components represent an image having an image resolution one octave lower than the original image. The image data having the lower resolution is subjected to further decomposition into frequency components in the horizontal direction and in the vertical direction. This procedure is repeated a predetermined number of times, and quantization and entropy coding are carried out with respect to each frequency component. If the original image is n-by-n pixels, an image having an image resolution three octaves lower than the original has a size that is n/8-by-n/8 pixels. In order to perform the wavelet transform for three octaves, the size of the original image should be a multiple of 8 by a multiple of 8. In practice, however, the image size is preferably 2m×2n (m, n: positive integer) so that the image can be further divided into those of lower resolution.
In terms of coding efficiency, it is preferable to perform the wavelet transform with respect to as big an image area as possible. Taking into account the cost of hardware implementation, however, an original image is generally divided into sub-regions of 256×256, 128×128, or 64×64, each of which is then subjected to wavelet transform.
In the system which performs orthogonal transform with respect to sub-regions into which an original image is divided, the size of the original image may not be a multiple of the size of a sub-region. In such a case, the original image is fitted into a wider area that is a multiple of a sub-region, and the wavelet transform is applied to the wider area by inserting padding data into blank areas around the original image. FIG. 1 is an illustrative drawing showing the way the padding data is inserted when the size of an original image is not a multiple of a sub-region. In FIG. 1, areas shown with hatches have padding data inserted therein. FIG. 2 is an illustrative drawing showing another example of padding data insertion. In this example, a sub-region to which the wavelet transform is applied is 128×128, and the original image that is to be coded has a size of 160×120. In the same manner as in FIG. 1, areas shown with hatches correspond to padding data areas. The size of 160×120 is typically used as a thumbnail image of a digital camera.
In the coding scheme that inserts padding data when the size of an original image is not a multiple of a sub-region, processing time will increase by an excess amount that is equal in amount to the padding data. If the coding applied is of an irreversible nature, the original image will be affected by padding data, causing a possible degradation of image quality after decoding. In terms of coding efficiency, it is desirable to apply transformation to as large an image area as possible. Since coding is performed on a sub-region-by-sub-region basis due to requirements for hardware implementation, however, image quality will be unduly degraded.
A system disclosed in Japanese Patent Laid-open Application No. 10-70722, image data of a desired size is obtained from original image data of any size by extending or interpolating the original image data, followed by wavelet transform for the coding purpose. In this scheme, however, processing for image extension or interpolation is complex, resulting in a complex hardware configuration and a cost increase.
Accordingly, there is a need for an image processing apparatus that can encode/decode image data of any size though a simple hardware configuration.